const FileSync = require('lowdb/adapters/FileSync')
const low = require('lowdb')
const adapter = new FileSync('db.json')
const db = low(adapter)
 
// Set some defaults 生成初始化json数据
// db.defaults({ posts: [], user: {} })
//   .write()
 
// // Add a post
// db.get('posts')
//   .push({ id: 1, title: 'lowdb is awesome'})
//   .write()
 
// // Set a user using Lodash shorthand syntax
db.set('user.name', 'typicode')
  .write()